home *** CD-ROM | disk | FTP | other *** search
/ Aminet 33 / Aminet 33 - October 1999.iso / Aminet / disk / misc / TransADF.lha / TransADF / Source / device.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-10-05  |  2.2 KB  |  62 lines

  1. /* device.h - Header file for device.c
  2. ** Copyright (C) 1998 Karl J. Ots
  3. ** 
  4. ** This program is free software; you can redistribute it and/or modify
  5. ** it under the terms of the GNU General Public License as published by
  6. ** the Free Software Foundation; either version 2 of the License, or
  7. ** (at your option) any later version.
  8. ** 
  9. ** This program is distributed in the hope that it will be useful,
  10. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. ** GNU General Public License for more details.
  13. ** 
  14. ** You should have received a copy of the GNU General Public License
  15. ** along with this program; if not, write to the Free Software
  16. ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  17. */
  18.  
  19. #ifndef TRANSADF_DEVICE_H
  20. #define TRANSADF_DEVICE_H
  21.  
  22. #ifndef EXEC_TYPES_H
  23. #include <exec/types.h>
  24. #endif /* EXEC_TYPES_H */
  25.  
  26. #ifndef EXEC_IO_H
  27. #include <exec/io.h>
  28. #endif /* EXEC_IO_H */
  29.  
  30.  
  31. /* Structure to carry information about a DOS Device */
  32. struct DeviceInfo {
  33.   STRPTR  dosName;          /* DOS name eg DF0:, RAD:, etc. without ':'.  */
  34.   STRPTR  deviceName;       /* Controlling device eg trackdisk.device.    */
  35.   ULONG   deviceUnit;       /* Device unit number.                        */
  36.   
  37.   ULONG   trackSize;        /* Size of a single track in bytes.           */
  38.   ULONG   numHeads;         /* Number of heads (surfaces) on device.      */
  39.   ULONG   lowTrack;         /* Lowest track number, (almost) always zero. */
  40.   ULONG   highTrack;        /* Hightest track number, 159 for DD floppys. */
  41. };
  42.  
  43. extern ULONG trackSize;
  44.  
  45. /*---------------------*/
  46. /* Function Prototypes */
  47. /*---------------------*/
  48.  
  49. struct DeviceInfo *getDeviceInfo (STRPTR dosDev);
  50. struct IOStdReq   *openDev (STRPTR devName, ULONG devUnit);
  51. void   closeDev  (struct IOStdReq *diskReq);
  52. BYTE readTrack   (APTR rBuffer, UBYTE rNumTracks, UBYTE rTrackNum,
  53.                   struct IOStdREq *rDiskReq);
  54. BYTE writeTrack  (APTR wBuffer, UBYTE wNumTracks, UBYTE wTrackNum, 
  55.                   struct IOStdReq *wDiskReq);
  56. BYTE formatTrack (APTR fBuffer, UBYTE fNumTracks, UBYTE fTrackNum, 
  57.                   struct IOStdReq *fDiskReq);
  58. BYTE flushTrack  (struct IOStdReq *DiskReq);
  59.  
  60.  
  61. #endif /* TRANSADF_DEVICE_H */
  62.